//
//  QTBClientCallCore.h
//  QTBClientDemo
//
//  Created by fan on 2021/10/20.
//

#import <Foundation/Foundation.h>
#import "QTBClientCallSession.h"
#import "QTBClientCallSessionInDelegate.h"
#import <QtbClient/QtbClient.h>


NS_ASSUME_NONNULL_BEGIN

FOUNDATION_EXPORT NSNotificationName const  CallingDidConnectNotification;  // 通话连接成功
FOUNDATION_EXPORT NSNotificationName const  CallingDidErrorNotification;  // 通话连接失败
FOUNDATION_EXPORT NSNotificationName const  CallingDidEndNotification;  // 通话结束
FOUNDATION_EXPORT NSNotificationName const  CallingTimeChangedNotification;  /// 通话时长更改
FOUNDATION_EXPORT NSNotificationName const  NativeClickActionNotification;  /// 原生调用h5
FOUNDATION_EXPORT NSNotificationName const  GetPatientsInfoNotification; /// 获取到患者信息
FOUNDATION_EXPORT NSNotificationName const  SetCurrentPatientNotification; /// 设置当前通话患者


typedef void(^QTBClientCallCoreCompletion)(int code, NSString *  msg);
typedef void(^QTBClientStartCallCallBack)(int code, NSString *  msg, QTBClientCallSession * callSession);



@interface QTBClientCallCore : NSObject

+(instancetype)shareCallCore;

/// 坐席状态
@property (nonatomic, assign) QtbStateType stateType;

@property (nonatomic, strong)QTBClientCallSession *currentCall;

-(void)setCallSessionInDelegate:(id <QTBClientCallSessionInDelegate>)delegate;//呼入

/// 登录
-(void)login:(NSString *)agent password:(NSString *)password type:(int)type host:(NSString *)host completion:(QTBClientCallCoreCompletion)completion;
/// 登出
-(void)logout:(QTBClientCallCoreCompletion)completion;
/// 呼叫坐席
-(void)startCallAgent:(NSString *)agent completion:(QTBClientStartCallCallBack)completion;
/// 呼叫外线
-(void)startCallPhone:(NSString *)phone completion:(QTBClientStartCallCallBack)completion;
/// 挂断
- (void)sendOnHook;
/// 接听
- (void)answerCall;

@end

NS_ASSUME_NONNULL_END
